import request from '@/utils/request'

// 查询借出归还记录列表
export function listRyLendingReturnRecord(query) {
  return request({
    url: '/warehouse/RyLendingReturnRecord/list',
    method: 'get',
    params: query
  })
}

// 查询借出归还记录详细
export function getRyLendingReturnRecord(id) {
  return request({
    url: '/warehouse/RyLendingReturnRecord/' + id,
    method: 'get'
  })
}

// 新增借出归还记录
export function addRyLendingReturnRecord(data) {
  return request({
    url: '/warehouse/RyLendingReturnRecord',
    method: 'post',
    data: data
  })
}

//修改仓库库存
//  逻辑：先传值  到后台后根据物品id和仓库id修改值
export function updateInventoryCurrenStock(data) {
  return request({
    url: '/warehouse/RyLendingReturnRecord/current',
    method: 'put',
    data: data
  })
}

// 修改借出归还记录
export function updateRyLendingReturnRecord(data) {
  return request({
    url: '/warehouse/RyLendingReturnRecord',
    method: 'put',
    data: data
  })
}

// 删除借出归还记录
export function delRyLendingReturnRecord(id) {
  return request({
    url: '/warehouse/RyLendingReturnRecord/' + id,
    method: 'delete'
  })
}
